package com.rmb.util;
//创建excel

import java.io.File;
import java.io.IOException;

import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;

/**
 * @version 1.0
 * @Author z
 * @Date 2021/1/8 19:40
 */

public class JxlWriteDemo {

    private static final Integer ZORE=0;
    private static final Integer THE=0;

    public static void main(String[] args) throws IOException, WriteException
    {
        File xlsFile = new File("jxl.xls");
        // 创建一个工作簿
        WritableWorkbook workbook = Workbook.createWorkbook(xlsFile);
        // 创建一个工作表
        WritableSheet sheet = workbook.createSheet("sheet1", ZORE);
        for (int row = ZORE; row < THE; row++)
        {
            for (int col = ZORE; col < THE; col++)
            {
                // 向工作表中添加数据
                sheet.addCell(new Label(col, row, "data" + row + col));
            }
        }
        workbook.write();
        workbook.close();
    }

}
